package com.pageoffice.util;

/**
 * description: System Util 系统工具
 * @version v1.0
 * @author w
 * @date 2018年12月3日下午3:03:35
 */
public class SystemUtil {
	
	private static final String OS_NAME_LINUX = "linux";
	
	private static final String OS_NAME_WINDOW = "window";
	
	public static Boolean isLinux(){
		return getOsName().toLowerCase().contains(OS_NAME_LINUX);
	}
	
	public static String getOsName(){
		return System.getProperty("os.name");
	}
	
	public static Boolean isWindows(){
		return getOsName().toLowerCase().contains(OS_NAME_WINDOW);
	}
	
	public static void main(String[] args) {
		String basePath = "c:/pan/d/";
		String file = basePath+"WEB-INF/views/SimpleWord/doc/test.doc";
		//	String file = basePath+"test.doc";
		if(SystemUtil.isLinux()){
			// linux os need suffix : file://
			file = "file://" + file ;
		}
		System.out.println(getOsName());
		System.out.println(file);
	}
}
